, it takes a fixed time assignment to the variable, which is fixed ctime=$ (date + "%h-%m-%s") # Shell env script location variables shell_name= "deploy.sh" # Script name shell_dir= "/h ome/www/"# Script path shell_log=" ${shell_dir}/${shell_namE}.log "# Script execution log file path # code env code variable pro_name=" Web-demo "# project name function code_dir="/deploy/code/web-demo "# Updated from version management system
Config_dir= "/deploy/config/web-demo" # Save configuration files for
server and enables the server to run in the background without occupying this Windows Terminal */
Server/init:
# Include "unp. H"
# Include "error. c"
# Include "wrap. c"
Void myinit ()
{
Char filename [50];
Char * cindir = getenv ("cindir ");
If (cindir = NULL)
Exit (0 );
If (Fork () = 0)
{
Memset (filename, 0, sizeof (filename ));
Sprintf (filename, "% S/bin/tcptest_server", cindir );
Chdir ("/");
Umask (0 );
Execlp (filename, "tcptest_server", (char *) 0 );
_ Exit (0 );
}
}
Int main (void)
{
executed, the script takes a fixed time assignment to the variable, which is a fixed ctime=$ (date + "%h-%m-%s") # Shell env script location Variable shell_name= ' deploy.sh # script name shell_dir= '/h ome/www/"# Script path shell_log=" ${shell_dir}/${shell_namE}.log "# Script execute log file path # code env code variable pro_name=" Web-demo "# project name function code_dir="/deploy/code/web-demo "# updated code from version management system
Record config_dir= "/deploy/config/web-demo" # S
write () method, Here's how to use it:Log.write ("Logging message!");When the software system development in half, for some reason can not continue to use the logging tool, need to use another logging tool, it also supports database logging DatabaseLog and text file records FileLog two ways, Only the API interface it provides to us is the Writelog () method, using the following method:Log.writelog ("Logging message!");The class structure diagram for
Copy codeThe Code is as follows: using System;
Using System. Data;
Using System. Configuration;
Using System. Data. OracleClient;
Using System. Text;
Using System. Windows. Forms;
Using System. Xml;
Using Transactions;
/// /// DB summary description Written By Luos. Luo, the creator of SalePlayer. Com
/// Public class MyOraDB
{
Public MyOraDB ()
{
}
Public int ExcuteSqlWithNoQuery (string vSql)
{
Int vI = 0;
OracleConnection vOracleConn = OpenOracleDBConn ();
Try
{
If (vOracleConn. State! = Conn
write mode.
Don ' t talk, show me the code.
1. Multithreading write files at the same time
Class program
{
static int logcount = m;
static int writedcount = 0;
static int failedcount = 0;
static void Main (string[] args)
{
//iterations run write logging, because multiple threads writing the same file at the same time will cause error
parallel.for (0, Logcount, e =>
{
writelog ();
});
Console.WriteLine (String. Format ("\r\nlog
Method() }
When void is changed to task, the writedata is clearly defined as an Asynchronous Method that needs to be waited. In this way, btnwrite_click will wait until the writedata execution is complete as we imagined before savedate is executed.
Use configureawait (false) to avoid deadlock
Let's improve the reading and writing of our files. When the writing fails, we may need to log in
public async void btnWrite_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
some reason, and another logging tool is required, it also supports database logging DatabaseLog and text file logging FileLog, except that it provides our API interface with the WriteLog () method. The usage is as follows:
Log. writeLog ("Logging Message! ");
The class structure of the logging tool is as follows:
Figure 4 Structure of Logging Tool
Its implementation code is as follows:
public abstract c
(additional Packages of Extra Packages for Enterprise Linux and Enterprise Linux) it is a software warehouse project maintained by the Fedora team and provides RHEL/CentOS with software packages they do not provide by default. Using this source saves a lot of trouble and saves the trouble of compiling source code. It should be noted that whether it is using the network yum source of centos or the epel extension source, you need your IP address to access the Internet.
Install gearman extensions
virtual host, to find out which site is under attack, you can view: C:windowssystem32logfileshttperr,
It is easy to analyze from the error log.
Writelog "netsh ipsec static add policy Name=xblue"
Writelog "netsh ipsec static add filterlist Name=denyip"
Overip= ""
F_name=logfilepath
' Specify log file
' Program function: Extract IP from logfiles into the filtering format required by IPSec, and import
The program mainly reads the IIS log of this website, analyzes the IP address, and automatically closes with security policy. The VBS code is as follows:
Copy Code code as follows:
' Code starts
Set fileobj=createobject ("Scripting.FileSystemObject")
Logfilepath= "E:w3logw3svc237ex070512old.log" note specifies the log path for the attacked Web site.
' If it is a virtual host, to find out which site is under attack, you can view: C:windowssystem32logfileshttperr,
It is easy t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.